from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver import ActionChains
from selenium.webdriver.common.keys import Keys
import time

# 选择浏览器
driver = webdriver.Chrome()
# 摩登学院注册网址
driver.get("https://my.pclady.com.cn/users/mobileRegister.jsp")

# 手机
input_username = driver.find_element(By.ID, "mobile")
# 密码
input_password = driver.find_element(By.ID, "password")
# 确认 密码
input_passwordConfirm = driver.find_element(By.ID, "passwordConfirm")

# 手机号
input_username.send_keys("18515088415")
# 等待1秒
time.sleep(1)

# 密码
input_password.send_keys("Lx12345678")
# 等待1秒
time.sleep(1)

# 确认密码
input_passwordConfirm.send_keys("Lx12345678")
# 等待1秒
time.sleep(1)

# 找到滑块
slot = driver.find_element(By.CLASS_NAME, "ui-slider-bg")

action = ActionChains(driver)

# 等待1s
time.sleep(1)

# 在160处停止
action.drag_and_drop_by_offset(slot, 160, 0)

action.perform()

# 等待5s
time.sleep(5)
# 退出浏览器
driver.quit()